package adminDynamicEnumHandler

import (
	exampleDtoApiPbAdminDynamicEnum "gitee.com/krio/ginc/example/dto/api/pb/admin/dynamic/enum"
	adminDynamicEnumService "gitee.com/krio/ginc/example/internal/admin/dynamic/enum/service"
	"github.com/gin-gonic/gin"
)

// DynamicEnumList 列表
func DynamicEnumList(ctx *gin.Context, req *exampleDtoApiPbAdminDynamicEnum.DynamicEnumListReq) (*exampleDtoApiPbAdminDynamicEnum.DynamicEnumListResp, error) {
	data, err := adminDynamicEnumService.DynamicEnumList(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// DynamicEnumDetail 详情
func DynamicEnumDetail(ctx *gin.Context, req *exampleDtoApiPbAdminDynamicEnum.DynamicEnumDetailReq) (*exampleDtoApiPbAdminDynamicEnum.DynamicEnumInfo, error) {
	data, err := adminDynamicEnumService.DynamicEnumDetail(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// DynamicEnumAdd 新增
func DynamicEnumAdd(ctx *gin.Context, req *exampleDtoApiPbAdminDynamicEnum.DynamicEnumInfo) (*exampleDtoApiPbAdminDynamicEnum.DynamicEnumAddResp, error) {
	data, err := adminDynamicEnumService.DynamicEnumAdd(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// DynamicEnumUpdate 修改
func DynamicEnumUpdate(ctx *gin.Context, req *exampleDtoApiPbAdminDynamicEnum.DynamicEnumInfo) (*exampleDtoApiPbAdminDynamicEnum.DynamicEnumAddResp, error) {
	data, err := adminDynamicEnumService.DynamicEnumUpdate(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// DynamicEnumDelete 删除
func DynamicEnumDelete(ctx *gin.Context, req *exampleDtoApiPbAdminDynamicEnum.DynamicEnumDeleteReq) (*exampleDtoApiPbAdminDynamicEnum.DynamicEnumDeleteResp, error) {
	data, err := adminDynamicEnumService.DynamicEnumDelete(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}
